.. _ocapowersensor: 1.1.2.11 OcaPowerSensor ======================== Class Hierarchy: :ref:`OcaRoot ` : :ref:`OcaWorker ` : :ref:`OcaSensor ` : :ref:`OcaPowerSensor ` .. cpp:class:: OcaPowerSensor: OcaSensor Power sensor. Reading shall be a watts value and a power factor value. **Properties**: .. _ocapowersensor_classid: .. cpp:member:: static const OcaClassID ClassID = "1.1.2.11" Number that uniquely identifies the class. Note that this differs from the object number, which identifies the instantiated object. This property is an override of the **OcaRoot** property. This property has id ``1.1``. .. _ocapowersensor_classversion: .. cpp:member:: static const OcaClassVersionNumber ClassVersion = 1 Identifies the interface version of the class. Any change to the class definition leads to a higher class version. This property is an override of the **OcaRoot** property. This property has id ``1.2``. .. _ocapowersensor_power: .. cpp:member:: OcaFloat32 Power Power in watts. This property has id ``4.1``. .. _ocapowersensor_powerfactor: .. cpp:member:: OcaFloat32 PowerFactor Power factor. Value shall range from 1 to zero, with 1 applying to a purely resistive circuit. This property has id ``4.2``. Properties inherited from :ref:`ocasensor`: - :cpp:texpr:`OcaClassID` :ref:`OcaRoot::ClassID ` - :cpp:texpr:`OcaClassVersionNumber` :ref:`OcaRoot::ClassVersion ` - :cpp:texpr:`OcaBoolean` :ref:`OcaRoot::Lockable ` - :cpp:texpr:`OcaLockState` :ref:`OcaRoot::LockState ` - :cpp:texpr:`OcaONo` :ref:`OcaRoot::ObjectNumber ` - :cpp:texpr:`OcaString` :ref:`OcaRoot::Role ` - :cpp:texpr:`OcaClassID` :ref:`OcaWorker::ClassID ` - :cpp:texpr:`OcaClassVersionNumber` :ref:`OcaWorker::ClassVersion ` - :cpp:texpr:`OcaBoolean` :ref:`OcaWorker::Enabled ` - :cpp:texpr:`OcaString` :ref:`OcaWorker::Label ` - :cpp:texpr:`OcaTimeInterval` :ref:`OcaWorker::Latency ` - :cpp:texpr:`OcaONo` :ref:`OcaWorker::Owner ` - :cpp:texpr:`OcaMap` :ref:`OcaWorker::PortClockMap ` - :cpp:texpr:`OcaList` :ref:`OcaWorker::Ports ` - :cpp:texpr:`OcaClassID` :ref:`OcaSensor::ClassID ` - :cpp:texpr:`OcaClassVersionNumber` :ref:`OcaSensor::ClassVersion ` - :cpp:texpr:`OcaSensorReadingState` :ref:`OcaSensor::ReadingState ` **Methods**: .. _ocapowersensor_getreading: .. cpp:function:: OcaStatus GetReading(OcaFloat32 &Power, OcaFloat32 &PowerFactor, OcaFloat32 &minPower, OcaFloat32 &maxPower) Gets the value and limits of the **Power** property, and the value of the **PowerFactor** propert**y**. This method has id ``4.1``. - :cpp:expr:`Power`: Output parameter. - :cpp:expr:`PowerFactor`: Output parameter. - :cpp:expr:`minPower`: Output parameter. - :cpp:expr:`maxPower`: Output parameter. Methods inherited from :ref:`ocasensor`: - :ref:`OcaSensor::GetClassIdentification ` - :ref:`OcaSensor::GetLockable ` - :ref:`OcaSensor::GetLockState ` - :ref:`OcaSensor::GetRole ` - :ref:`OcaSensor::SetLockNoWrite ` - :ref:`OcaSensor::SetLockNoReadWrite ` - :ref:`OcaSensor::Unlock ` - :ref:`OcaSensor::AddPort ` - :ref:`OcaSensor::DeletePort ` - :ref:`OcaSensor::DeletePortClockMapEntry ` - :ref:`OcaSensor::GetEnabled ` - :ref:`OcaSensor::GetLabel ` - :ref:`OcaSensor::GetLatency ` - :ref:`OcaSensor::GetOwner ` - :ref:`OcaSensor::GetPath ` - :ref:`OcaSensor::GetPortClockMap ` - :ref:`OcaSensor::GetPortClockMapEntry ` - :ref:`OcaSensor::GetPortName ` - :ref:`OcaSensor::GetPorts ` - :ref:`OcaSensor::SetEnabled ` - :ref:`OcaSensor::SetLabel ` - :ref:`OcaSensor::SetLatency ` - :ref:`OcaSensor::SetPortClockMap ` - :ref:`OcaSensor::SetPortClockMapEntry ` - :ref:`OcaSensor::SetPortName ` - :ref:`OcaSensor::GetReadingState `